<body class="gray-bg">
<div class="ibox-title">基本信息</div>
<div class="ibox-content">
    <div class="row">
        <div class="col-sm-12">
            {$info.business_info.summary_html}
        </div>
    </div>
</div>

<!--审批处理-->
<div class="ibox-title">审批处理</div>
<div class="ibox-content">
    <form class="form-horizontal" method="post" action="{:url('WorkflowBusinessHistory/approval')}">
        <input type="hidden" name="wbhid" value="{$info.id|default='0'}">
        <div class="form-group">
            <label class="col-sm-2 control-label">审批流程</label>
            <div class="col-sm-10">
                <p class="form-control-static">{$info.workflow_list}</p>
                <span class="help-block m-b-none"></span></div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">当前处理</label>
            <div class="col-sm-10">
                <p class="form-control-static">{$info.curr_node_name} ({$info.deal_user_name}) </p>
                <span class="help-block m-b-none"></span>
            </div>
        </div>
        {if condition="$info.deal_status eq 0"}
        <div class="deal_status_box0">
            <div class="form-group">
                <label class="col-sm-2 control-label">处理动作</label>
                <div class="col-sm-10">
                    <div class=" approval_deal_status">
                        <div class="radio radio-info radio-inline">
                            <input type="radio" id="deal_status1" value="1" name="deal_status" checked='checked'>
                            <label for="deal_status1"> 通过 </label>
                        </div>
                        <div class="radio radio-info radio-inline">
                            <input type="radio" id="deal_status2" value="2" name="deal_status">
                            <label for="deal_status2"> 拒绝 </label>
                        </div>
                        <div class="radio radio-info radio-inline">
                            <input type="radio" id="deal_status3" value="3" name="deal_status">
                            <label for="deal_status3"> 转发 </label>
                        </div>

                    </div>
                    <span class="help-block m-b-none"></span>
                </div>
            </div>
            <div class="form-group reject_box">
                <label class="col-sm-2 control-label">返回节点</label>
                <div class="col-sm-10">
                    <select name="reject_step" class="form-control">
                        <option value="0">驳回重新提交</option>
                        <option value="1">返回上一步</option>
                    </select>
                    <span class="help-block m-b-none"></span></div>
            </div>
            <div class="form-group forward_box">
                <label class="col-sm-2 control-label">转发人员</label>
                <div class="col-sm-10">
                    <div class="input-group">
                        <input type="hidden" name="forward_user_id">
                        <input type="text" name="forward_user_name" id="forward_user_name" class="form-control"
                               placeholder="选择指定人员" readonly>
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-info ajax-open" data-calback="javascript:void(0);"
                                    data-url="{:url('admin/SysUser/lookup',array('input_ids'=>'forward_user_id','input_text'=>'forward_user_name'))}">选择人员 </button>
                        </span>
                    </div>
                    <span class="help-block m-b-none"></span></div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">备注说明</label>
                <div class="col-sm-10">
                    <textarea class="form-control" name="suggestion_feedback"></textarea>
                    <span class="help-block m-b-none"></span></div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-8">
                    {include file="admin@layout/save_btn"}
                </div>
            </div>
        </div>
        {else /}
        <div class="deal_status_box1">

            <div class="form-group">
                <label class="col-sm-2 control-label">审批结果</label>
                <div class="col-sm-10">
                    <p class="form-control-static">{$info.deal_status_arr.html|default=''}</p>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">审批说明</label>
                <div class="col-sm-10">
                    <p class="form-control-static">{$info.suggestion_feedback|default=''}</p>
                </div>
            </div>
        </div>

        {/if}
    </form>
</div>

<div class="ibox-title">审批记录</div>
<div class="ibox-content">
    <table class="table table-hover sorttable ajax-list-table" width="100%">
        <thead>
        <tr>
            <th width="120">创建时间</th>
            <th width="120">审批节点</th>
            <th width="100">审批人</th>
            <th width="120">审核结果</th>
            <th width="120">审批时间</th>
            <th width="200">备注说明</th>
        </tr>
        </thead>
        <tbody>
        <!--        审批历史记录-->
        {notempty name='info.workflow_business_history'}
        {volist name='info.workflow_business_history' id='vo'}
        <tr>
            <td width="120">{$vo.create_time}</td>
            <td width="120">{$vo.curr_node_name}{$vo.sign_type_name}</td>
            <td width="100">{$vo.deal_user_name}</td>
            <td width="120">{$vo.deal_status_name}</td>
            <td width="120">{$vo.deal_time}</td>
            <td width="200">{$vo.suggestion_feedback}</td>
        </tr>
        {/volist}
        {/notempty}
        </tbody>
    </table>
</div>
<script>
    approval_type();
    $('.approval_deal_status input[name="deal_status"]').on('click', function (e, params) {
        approval_type();
    });

    function approval_type() {
        var val = $('.approval_deal_status input[name="deal_status"]:checked').val();
        $('.reject_box').css('display', 'none');
        $('.forward_box').css('display', 'none');
        if (val == 2) {
            $('.reject_box').css('display', 'block');
        } else if (val == 3) {
            $('.forward_box').css('display', 'block');
        }
    }

</script>